#include "FPod.h"
#include "FPodReader.h"
#include "FType.h"

using namespace std;


/**
 * TODOC
 */
void FPod::load(const string& podPath)
{
  FPodReader reader;
  reader.openPod(podPath);
}


/**
 * TODOC
 */
void FPod::loadConstants(FPodReader& reader)
{
  m_constants.load(reader);
}


/**
 * TODOC
 */
void FPod::loadNames(FPodReader& reader)
{
  m_names.clear();
  reader.setCurrentFile("names.def");
  uint16_t numNames = reader.readUInt16();
  for (uint16_t i = 0; i < numNames; i++)
    m_names.push_back(reader.readString());
}


/**
 * TODOC
 */
void FPod::loadTypes(FPodReader& reader)
{
  m_types.clear();
  reader.setCurrentFile("types.def");
  uint16_t numTypes = reader.readUInt16();
  for (uint16_t i = 0; i < numNames; i++)
  {
    FType type;
    type.read(reader);
    m_types.push_back(type);
  }
}
